tools/xen-detect: try sysfs node for obtaining guest type
authorJuergen Gross <jgross@suse.com>
Thu, 15 Jun 2017 09:58:27 +0000 (11:58 +0200)
committerWei Liu <wei.liu2@citrix.com>
Wed, 21 Jun 2017 13:15:55 +0000 (14:15 +0100)
commit48d0c822640f8ce4754de16f1bee5c995bac7078
tree31bae9f87a969ac72d22e84ade3dc249677aa29b
parentd8f1b48fd665d7aad1711de2f073540d07d2d041
tools/xen-detect: try sysfs node for obtaining guest type

Instead of relying on cpuid instruction behaviour to tell which domain
type we are just try asking the kernel via the appropriate sysfs node
(added in Linux kernel 4.13).

Keep the old detection logic as a fallback for older kernels.

Signed-off-by: Juergen Gross <jgross@suse.com>
tools/misc/xen-detect.c